package cn.bluethink.eguan.core.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.bluethink.eguan.core.security.Token;
import cn.bluethink.eguan.core.service.EgBtsService;
import cn.bluethink.eguan.filter.BtsFilter;
import cn.bluethink.eguan.model.core.EgBts;
import cn.bluethink.eguan.result.PageInfo;
import cn.bluethink.eguan.result.ResponseMessage;
import cn.bluethink.eguan.result.ResponseResult;

/**
 * 金币流通记录控制器
 * 
 * @author 苏州中科蓝迪公司所有(c)2016-2021
 * @version 0.3.0
 * @brief 驿馆+产品
 * @note 修订历史：
 *       1.wanglei于2018/12/06设计并构建初始版本v0.3.0
 */
@CrossOrigin
@RestController
@RequestMapping("/eguan/v1.0/bts")
public class EgBtsController {

    @Autowired
    private EgBtsService btsService;
    
    /**
     * 过滤查询金币流通记录
     * 
     * @param filter
     * @return
     * @throws Exception
     */
    @Token
    @PostMapping("/query")
    public ResponseResult<PageInfo<EgBts>> query(@RequestBody BtsFilter filter) throws Exception {
        return new ResponseResult<>(ResponseMessage.OK, btsService.query(filter));
    }
}
